<?Php
if ( ! function_exists('show'))
{
	function  show($view, $data="")
	{
		global $template;		
		$ci = &get_instance();
		$data['view'] = $view;		
		
		$ci->load->view('frontend/main.php', $data);
	}	
	
		function  show2($view, $data="")
	{
		global $template;		
		$ci = &get_instance();
		$data['view'] = $view;		
		
		$ci->load->view('frontend/main2.php', $data);
	}	
	
		function  show3($view, $data="")
	{
		global $template;		
		$ci = &get_instance();
		$data['view'] = $view;	
		$ci->load->view('main3.php', $data);
	}	
	
	function  show_backend($view, $data="")
	{
		global $template;		
		$ci = &get_instance();
		$data['view'] = $view;		
		
		$ci->load->view('backend/main.php', $data);
	}	
	
	function deleteDirectory($dir) {
		if (!file_exists($dir)) return true;
		if (!is_dir($dir) || is_link($dir)) return unlink($dir);
			foreach (scandir($dir) as $item) {
				if ($item == '.' || $item == '..') continue;
				if (!deleteDirectory($dir . "/" . $item)) {
					chmod($dir . "/" . $item, 0777);
					if (!deleteDirectory($dir . "/" . $item)) return false;
				};
			}
			return rmdir($dir);
    }
	
	function get_paging(){
		
	}
	
	function fbAppsId() {
		return '507422122627183';
	}
	function getTwitStatus($mention="goyz87") {
	//$jsonpath = "http://search.twitter.com/search.json?q=".urlencode($mention)."&rpp=5&include_entities=true&result_type=mixed";
		$jsonpath = "http://api.twitter.com/1/statuses/user_timeline/".$mention.".json";
		$decode   = file_get_contents($jsonpath);
		$data   = json_decode($decode);
		return $data;
	}
	
	function fbfanpage($width="", $height="", $stream=false) {
		return '<iframe src="//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fbikinkaosbebasdotcom&amp;width='.$width.'&amp;height='.$height.'&amp;show_faces=true&amp;colorscheme=light&amp;stream=true&amp;show_border=true&amp;header=true" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:'.$width.'px; height:'.$height.'px;" allowTransparency="true"></iframe>';
	}
		
		
	
}